﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace MyManageViewControl
{
    public partial class CourseManageView : ManageView
    {

        public event EventHandler CourseIdChange;

        public string CourseId
        {
            get { return tbxCourseId.Text; }
            set { tbxCourseId.Text = value; }
        }

        public string CourseName
        {
            get { return tbxCourseName.Text; }
            set { tbxCourseName.Text = value; }
        }

        public byte NumberOfCredit
        {
            get { return byte.Parse(tbxCredit.Text); }
            set { tbxCredit.Text = value.ToString(); }
        }

        public CourseManageView()
        {
            InitializeComponent();
        }

        private void CourseManageView_Load(object sender, EventArgs e)
        {

        }

        private void tbxCourseId_DoubleClick(object sender, EventArgs e)
        {
            tbxCourseName.Text = "";
            tbxCredit.Text = "";

            if (CourseIdChange != null)
            {
                CourseIdChange(sender, e);
            }

        }

    }
}
